home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / editor / chktex.lha / chktex / source / ChkTeX.h < prev    next >
C/C++ Source or Header  |  1996-01-25  |  17KB  |  710 lines

  1. /*
  2.  *  ChkTeX v1.2, header file for main program.
  3.  *  Copyright (C) 1995-96 Jens T. Berger Thielemann
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  Contact the author at:
  20.  *        Jens Berger
  21.  *        Spektrumvn. 4
  22.  *        N-0666 Oslo
  23.  *        Norway
  24.  *        E-mail: <jensthi@ifi.uio.no>
  25.  *
  26.  *
  27.  */
  28.  
  29. /********************************************************************/
  30. /**************** START OF USER SETTABLE PREFERENCES ****************/
  31.  
  32. /*
  33.  * Note: This file contains most defines you'll wish to change if you
  34.  * wish to adopt ChkTeX to a new system. It is, as you might notice,
  35.  * heavily documented. If you wish to get into the internals of ChkTeX,
  36.  * the interesting stuff is at the bottom of this file, and in the .c
  37.  * files.
  38.  *
  39.  * This program relies heavily on that the system which
  40.  * automagically free()'s all malloc()'ed memory, works. The program
  41.  * itself does not call free() very much. This is because we're doing
  42.  * lots of tiny allocations, and a properly designed pooling system will
  43.  * hopefully do a quicker job than we'll be able to do. So there.
  44.  *
  45.  * To keep things simple, we trust that the fclose()'ing of fopen()'ed
  46.  * also happens automagically.
  47.  *
  48.  * Please use the getopt included, as we will modify optarg during
  49.  * command processing.
  50.  *
  51.  * I've #ifdef'ed out quite a few functions, so you can pick only those
  52.  * you need. If you've got a similar routine in your local library, please
  53.  * use that one if you can, as this will probably give you a better
  54.  * routine (it may even have been coded in asm).
  55.  *
  56.  * Please note that isalpha(), isdigit() and similar routines may _not_
  57.  * be implemented as macros; we'll use these as callback hooks. For your
  58.  * convenience, we will #undef'ine these for you; however, you must make
  59.  * sure that they exist in a library.
  60.  *
  61.  * You may wish to modify the SetupVars() to better suit your
  62.  * preferences. In any case, it should put the filename (and full path)
  63.  * of the `.chktexrc' file into the ConfigFile array. The array is sized
  64.  * BUFLEN bytes.
  65.  *
  66.  * The program does also assume that AMIGA is defined if the source
  67.  * compiled on an Amiga machine, and that __unix__ is defined if the
  68.  * source is compiled on a UNIX machine.
  69.  *
  70.  */
  71.  
  72.  
  73. /*
  74.  * The settings below work well with GCC. If you've got another compiler,
  75.  * you should read through the whole file and define the settings yourself.
  76.  * If you're using SAS/C Amiga, no adjustments have to be done at all. You
  77.  * should, however, still have the SCOPTIONS file in the directory, to
  78.  * optimize things a bit more.
  79.  *
  80.  * The #defines are necessary to use some non-ANSI functions, which exist
  81.  * only on some compilers. Btw., realloc() appears to be broken on GCC (at
  82.  * least on the version I found at our university).
  83.  */
  84.  
  85. #ifdef __GNUC__
  86. #    define stricmp strcasecmp
  87. #    define    STRUPR_NEED
  88. #    define STRMID_NEED
  89. #endif
  90.  
  91. #ifdef __unix__
  92. #    define    NO_TICTOC
  93. #endif
  94.  
  95. /*
  96.  * You'll have to define stricmp(a, b) to a function which does
  97.  * case-insensitive comparison between a and b.
  98.  */
  99.  
  100. /*
  101. #define stricmp        strcasecmp
  102. */
  103.  
  104. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  105.  
  106. /*
  107.  * If you have a compiler which doesn't like prototypes, uncomment
  108.  * the following line.
  109.  */
  110.  
  111. /*
  112. #define __NOPROTO
  113. */
  114.  
  115. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  116.  
  117. /*
  118.  * Uncomment the following line if your compiler does not have the
  119.  * strdup() function, which returns a duplicate of the string passed.
  120.  */
  121.  
  122. /*
  123. #define STRDUP_NEED
  124. */
  125.  
  126. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  127.  
  128. /*
  129.  * Uncomment the following line if your compiler does not have the
  130.  * strupr() function, which makes the string passed into uppercase.
  131.  */
  132.  
  133. /*
  134. #define STRUPR_NEED
  135. */
  136.  
  137.  
  138. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  139.  
  140. /*
  141.  * Uncomment the following line if you need the
  142.  * strmid(source, dest, pos, len) function, which copies a string
  143.  * with a maximum length of `len' starting at `pos' in `source' into
  144.  * `dest'. Should return -1 if the pos value is beyond the length of the
  145.  * source value, else NULL.
  146.  */
  147.  
  148. /*
  149. #define    STRMID_NEED
  150. */
  151.  
  152.  
  153. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  154.  
  155. /*
  156.  * Here you should define what codes which should be returned to the
  157.  * shell upon success/failure.
  158.  *
  159.  */
  160.  
  161. #ifndef EXIT_FAILURE
  162. #    ifdef  AMIGA
  163. #        define    EXIT_FAILURE    20
  164. #    else
  165. #        define    EXIT_FAILURE    1
  166. #    endif
  167. #endif
  168.  
  169. #ifndef EXIT_SUCCESS
  170. #    define    EXIT_SUCCESS    0
  171. #endif
  172.  
  173. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  174.  
  175. /*
  176.  * SLASH should be defined to the character your computer uses to
  177.  * separate files/directories. Most systems use '/', messydos uses
  178.  * '\'.
  179.  *
  180.  * DIRCHARS should be defined to the characters a directory entry
  181.  * may end on. On Amigas, this is ":/" (either "FOO:BAR/" or "FOO:"),
  182.  * Unix uses only "/", while messydos uses ":\\".
  183.  *
  184.  * This data will be used to automatically concatenate a directory
  185.  * path and a filename.
  186.  *
  187.  * Adjust both to suit your needs.
  188.  */
  189.  
  190.  
  191. #if defined(__unix__) || defined(AMIGA)
  192. #    define    SLASH        '/'
  193. #endif
  194.  
  195. #if defined(__unix__)
  196. #    define DIRCHARS    "/"
  197. #elif defined(AMIGA)
  198. #    define DIRCHARS    ":/"
  199. #endif
  200.  
  201. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  202.  
  203. /*
  204.  * Define this constant if you want a slower program which isn't
  205.  * that wasteful concerning memory.
  206.  */
  207.  
  208. /*
  209. #define NO_DIRTY_TRICKS
  210. */
  211.  
  212.  
  213. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  214.  
  215. /*
  216.  * This will be the length of our buffers. If you're operating with
  217.  * extremely long lines, you may wish to increase this one to avoid
  218.  * errors. They should be non-fatal, but may cause extra spaces to be
  219.  * inserted in the input.
  220.  *
  221.  * In most cases, however, your C provider has already set an
  222.  * appropiate value for BUFSIZ.
  223.  */
  224. #define BUFLEN    BUFSIZ
  225.  
  226. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  227.  
  228. /*
  229.  * Uncomment the following line if you don't wish to have any
  230.  * `twirling baton' (`\|/-'). Is a waste of cycles if you've got
  231.  * a speedy CPU. Some displays do also not like this huge amount
  232.  * of carriage returns without a subsequent line feed.
  233.  *
  234.  * You may also just use the -t0 or -v0 option at runtime.
  235.  */
  236.  
  237. /*
  238. #define NO_TICTOC
  239. */
  240.  
  241. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  242.  
  243. /*
  244.  * We're killing \verb@foo@ commands by overwriting them with a single
  245.  * character. This should not be an alphabetic character (in case the user
  246.  * writes (\foo\verb@bar@), neither should it be one of LaTeX' reserved
  247.  * characters (`#$%&~_^\{}'), or any parenthesis character ('()[]{}').
  248.  * If possible, don't use a punctuation character, either, or any spacing
  249.  * character. The asterix is also unsuitable, as some commands behave in
  250.  *  another way if they are postpended with an asterix.  Which more or less
  251.  * leaves us with the pipe.  Still set to changeable; no one knows (not even 
  252.  * you? :-) ) what your LaTeX configuration is.
  253.  */
  254.  
  255.  
  256. #define VERBCLEAR    '|'
  257.  
  258. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  259.  
  260. /*
  261.  * For fancy printing of commands, we'll use these strings to turn
  262.  * on/off the error indication. The codes listed here are ANSI
  263.  * compatible; if you don't have that type of terminal, you may wish
  264.  * to adjust this. Use "chktex -v2 Test.tex" to check the effects of
  265.  * these macros. Note: These strings will be printf()'ed, so watch your
  266.  * %'s.
  267.  *
  268.  * On VT10[02] terminals, these values will be ignored; we'll use
  269.  * the sequence "_\b%c" for each character instead.
  270.  *
  271.  * PRE_ERROR_STR is of course printed in front of each location we
  272.  * wish to show as an error, and POST_ERROR_STR after each location.
  273.  *
  274.  * The codes #defined here, will switch back- and foreground colours.
  275.  * We're using '\033[' as escape character, some terminals may like
  276.  * '\233' better.
  277.  *
  278.  */
  279.  
  280. #define    PRE_ERROR_STR    "\033[7m"
  281. #define POST_ERROR_STR    "\033[0m"
  282.  
  283. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  284.  
  285. /*
  286.  * The next macro should return TRUE if the character should be
  287.  * stripped from a string, e.g. if it is a space, tab, control
  288.  * character or any other `invisible' character. I've listed a few
  289.  * alternatives which should work OK on ASCII X3.64 machines, select the
  290.  * one that fits (or create your own :) ). Please embrace it with
  291.  * parentheses.
  292.  */
  293.  
  294. /*
  295.  * This one is the most correct one - should always work
  296. #define    SKIP_STRIP(c)    (isspace(c) || iscntrl(c))
  297.  *
  298.  * This one works better on ANSI X3.64-1979 terminals
  299. #define SKIP_STRIP(c)    ((c > 0 && <= ' ') || (c >= 0x7f && c <= 0xa0))
  300.  *
  301.  * This one works on 7-bits terminals, which is enough for most people.
  302.  */
  303.  
  304. #define SKIP_STRIP(c)    (c > 0 && c <= ' ')
  305.  
  306. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  307.  
  308. /*
  309.  * The next macro should return TRUE if LaTeX (and you?) considers
  310.  * the character `c' as a space, which should be detected when
  311.  * we're checking whether commands are terminated by spaces.
  312.  *
  313.  * The alternatives listed above should be suitable here, too.
  314.  */
  315.  
  316. #define LATEX_SPACE(c)    (c > 0 && c <= ' ')
  317.  
  318. /*  -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=-  */
  319.  
  320. /*
  321.  * The next macro should return TRUE if LaTeX (and you?) considers
  322.  * the character `c' as an end-of-sentence character, which should be
  323.  * detected when whether sentence spacing is correct.
  324.  *
  325.  */
  326.  
  327. /*
  328.  * LaTeX defines the following as punctuation characters; however, all of
  329.  * them are not considered end-of-sentence characters.
  330.  *
  331. #define LATEX_PUNCT(c)    (strchr(".:;,?!`'()[]{}-/*@", c))
  332.  *
  333.  * You may also wish to use this one instead:
  334.  *
  335. #define LATEX_PUNCT(c)    ispunct(c)
  336.  */
  337.  
  338. #define LATEX_PUNCT(c)    (strchr(".:?!", c))
  339.  
  340.  
  341.  
  342. /***************** END OF USER SETTABLE PREFERENCES *****************/
  343. /********************************************************************/
  344.  
  345.  
  346. #include <ctype.h>
  347. #include <limits.h>
  348. #include <math.h>
  349. #include <stdio.h>
  350. #include <stdarg.h>
  351. #include <stddef.h>
  352. #include <stdlib.h>
  353.  
  354. #define _STRICT_ANSI
  355. #include <string.h>
  356.  
  357. #ifdef AMIGA
  358. #    include <exec/execbase.h>
  359. #endif
  360.  
  361. #ifdef __unix__
  362. #    include <unistd.h>
  363. #endif
  364.  
  365. #include "exec/types.h"
  366. #include "getopt.h"
  367.  
  368. /* We don't _really_ need it, but it's nice to keep consistent */
  369.  
  370. #ifdef __SASC
  371. #    ifdef    _STRICT_ANSI
  372. #        define    STRUPR_NEED
  373. #        define    STRMID_NEED
  374. #        define    STRDUP_NEED
  375. #    endif
  376. #endif
  377.  
  378. #ifdef isalnum
  379. #    undef isalnum
  380. #endif
  381.  
  382. #ifdef isalpha
  383. #    undef isalpha
  384. #endif
  385.  
  386. #ifdef iscntrl
  387. #    undef iscntrl
  388. #endif
  389.  
  390. #ifdef isdigit
  391. #    undef isdigit
  392. #endif
  393.  
  394. #ifdef isgraph
  395. #    undef isgraph
  396. #endif
  397.  
  398. #ifdef islower
  399. #    undef islower
  400. #endif
  401.  
  402. #ifdef isprint
  403. #    undef isprint
  404. #endif
  405.  
  406. #ifdef ispunct
  407. #    undef ispunct
  408. #endif
  409.  
  410. #ifdef isspace
  411. #    undef isspace
  412. #endif
  413.  
  414. #ifdef isupper
  415. #    undef isupper
  416. #endif
  417.  
  418. #ifdef isxdigit
  419. #    undef isxdigit
  420. #endif
  421.  
  422.  
  423. /*
  424.  * This is the name of the global resource file.
  425.  */
  426.  
  427. #define RCFILE            ".chktexrc"
  428.  
  429.  
  430. /*
  431.  * How many indexes we'll allocate first time
  432.  */
  433. #define MINPUDDLE    256
  434.  
  435.  
  436. /*
  437.  * How many bytes we want in front/end of each UBYTE buffer.
  438.  */
  439.  
  440. #define WALLBYTES    2
  441.  
  442. #define    betw(a,b,c)        ((a < b) && (b < c))
  443. #define within(a,b,c)    ((a <= b) && (b <= c))
  444. #define elif            else if
  445. #ifndef NOT
  446. #    define NOT(a)            (!(a))
  447. #endif
  448. #define ifn(a)            if(NOT(a))
  449.  
  450. #ifndef min
  451. #    define min(a,b)    ((a)<=(b)?(a):(b))
  452. #endif
  453.  
  454. #ifndef max
  455. #    define max(a,b)    ((a)>(b)?(a):(b))
  456. #endif
  457.  
  458.  
  459. #define QUOTE    '\"'    /* Char used to quote text containing blanks    */
  460. #define ESCAPE    '!'        /* Char used to access special characters        */
  461. #define CMNT    '#'        /* Char used as comment                            */
  462.  
  463. enum ErrNum
  464. {
  465.     emMinFault = 0,
  466.     emSpaceTerm,    emNBSpace,        emEnclosePar,    emItInNoIt,
  467.     emItDup,        emNoItFound,    emAccent,        emWrongDash,
  468.     emExpectC,        emSoloC,        emEllipsis,        emInterWord,
  469.     emInterSent,    emNoArgFound,    emNoMatchC,        emMathStillOn,
  470.     emNoMatchCC,    emUseQuoteLiga,    emUseOtherQuote,emUserWarn,
  471.     emNotIntended,    emComment,        emThreeQuotes,    emFalsePage,
  472.     emEmbrace,
  473.     emMaxFault
  474. };
  475.  
  476. enum PrgErrNum {
  477.     pmMinFault = 0,
  478.  
  479.     pmUnknownTerm,    pmNoFileMatch,    pmNoTeXOpen,    pmRename,
  480.     pmRenameErr,    pmOutOpen,        pmOutTwice,        pmStrDupErr,
  481.     pmWordListErr,    pmNoStackMem,    pmWarnNumErr,    pmVerbLevErr,
  482.     pmNotPSDigit,    pmEscCode,        pmKeyWord,        pmBraceCnt,
  483.     pmRsrcOpen,
  484.  
  485.     pmMaxFault,
  486. };
  487.  
  488.  
  489. extern 
  490.     struct ErrMsg 
  491.         LaTeXMsgs [emMaxFault + 1],
  492.         PrgMsgs [pmMaxFault + 1];
  493.  
  494.  
  495.  
  496. enum TermType
  497. {
  498.     tmAnsi,
  499.     tmVT100,
  500.     tmUnknown
  501. };
  502.  
  503. struct    ErrMsg
  504. {
  505.     enum ErrNum    Number;
  506.     enum
  507.     {
  508.         etMsg,
  509.         etWarn,
  510.         etErr
  511.     }        Type;
  512.     BOOL    InUse;
  513.     STRPTR    Message;
  514. };
  515.  
  516. struct Stack
  517. {
  518.     APTR    *Data;
  519.     ULONG    Size, Used;
  520. };
  521.  
  522. struct WordList
  523. {
  524.     struct Stack    Stack;
  525.     BOOL            Sorted;
  526. };
  527.  
  528. struct CharInfo
  529. {
  530.     UBYTE    Char;
  531.     ULONG    Line, Column;
  532.     STRPTR    LineBuf;
  533. };
  534.  
  535.  
  536. #define    STRP_LFT            1
  537. #define    STRP_RGT            2
  538. #define    STRP_BTH            (STRP_LFT|STRP_RGT)
  539.  
  540. #ifndef __NOPROTO
  541. #    ifndef __PROTO
  542. #        define __PROTO(a) a
  543. #    endif
  544. #else
  545. #    ifndef __PROTO
  546. #        define __PROTO(a) ()
  547. #    endif
  548. #endif
  549.  
  550. #define    NEWBUF(name,len)                                \
  551. static                                                    \
  552.     UBYTE    _##name        [len  + (WALLBYTES<<1)] = {0};    \
  553.     STRPTR    name =        &_##name[WALLBYTES]
  554.  
  555. extern 
  556.     STRPTR    ReadBuffer,
  557.             CmdBuffer,
  558.             TmpBuffer;
  559. extern
  560.     UBYTE    ConfigFile[BUFLEN];
  561.  
  562. extern struct WordList
  563.     Silent    ,
  564.     Abbrev    ,
  565.     Linker    ,
  566.     IJAccent,
  567.     Italic    ,
  568.     UserWarn,
  569.     CmdLine    ,
  570.     PostLink,
  571.     *CurRead;
  572.  
  573. extern 
  574.     struct Stack
  575.         CharStack;
  576.  
  577.  
  578. #define NUMBRACKETS        6
  579.  
  580. extern const
  581.     UBYTE BrOrder[NUMBRACKETS + 1];
  582.  
  583. extern
  584.     ULONG Brackets    [NUMBRACKETS];
  585.  
  586. extern enum TermType TermType;
  587.  
  588. extern
  589.     BOOL    AtLetter,            /* Whether `@' is a letter or not.        */
  590.             MathMode;            /* Whether we're in math mode or not    */
  591.  
  592. extern
  593.     ULONG    ErrPrint,            /* # errors printed                     */
  594.             WarnPrint,            /* # warnings printed                    */
  595.             UserSupp;            /* # user suppressed warnings            */
  596.  
  597. enum Verbosity
  598. {
  599.     vbSilent = 0,
  600.     vbNormal,
  601.     vbFancy
  602. };
  603.  
  604. enum ItState {
  605.     itOff,
  606.     itOn,
  607.     itCorrected
  608. };
  609.  
  610. extern 
  611.     enum ItState
  612.         ItState;
  613.  
  614. extern
  615.     LONG Verbosity;
  616.  
  617. extern
  618.     FILE *OutputFile, *InputFile;
  619.  
  620. extern
  621.     STRPTR 
  622.         OutputName,
  623.         InputName;
  624.  
  625. extern
  626.     STRPTR
  627.         Delimit;
  628.  
  629. extern
  630.     BOOL     GlobalRC, WipeVerb, TicToc,    BackupOut,
  631.             Quiet, LicenseOnly, UsingStdIn;
  632.  
  633.  
  634.  
  635. void        AddBracket        __PROTO((UBYTE const));
  636. ULONG        BrackIndex        __PROTO((UBYTE const));
  637. BOOL        fexists            __PROTO((STRPTR Filename));
  638. BOOL        FindErr            __PROTO((STRPTR const, ULONG const));
  639. STRPTR        GetLTXArg        __PROTO((STRPTR, STRPTR, const UBYTE));
  640. BOOL        HasWord            __PROTO((STRPTR const, struct WordList *));
  641. BOOL        InsertWord        __PROTO((STRPTR const, struct WordList *));
  642. int            main            __PROTO((int argc, char **argv));
  643. UBYTE        MatchBracket    __PROTO((UBYTE const));
  644. STRPTR        MatchFileName    __PROTO((STRPTR String));
  645. BOOL        OpenOut            __PROTO((void));
  646. int            ParseArgs        __PROTO((ULONG argc, char **argv));
  647. int            ParseBoolArg    __PROTO((BOOL *Dest, STRPTR *Argument));
  648. int            ParseNumArg        __PROTO((LONG *, LONG, STRPTR *));
  649. void        PerformCommand    __PROTO((STRPTR const));
  650. struct CharInfo *
  651.             PopChar            __PROTO((struct Stack *));
  652. void        PrintError        __PROTO((STRPTR const, LONG, LONG const,
  653.                                 const LONG, enum ErrNum const, ...));
  654. void        PrintPrgErr        __PROTO((enum PrgErrNum Error, ...));
  655. void        PrintStatus     __PROTO((ULONG));
  656. BOOL        PushChar        __PROTO((const UBYTE c, const ULONG Line,
  657.                                 const ULONG Column, struct Stack *Stk,
  658.                                 const STRPTR LineCpy));
  659. STRPTR        ReadLine        __PROTO((STRPTR, FILE *));
  660. BOOL        ReadRC            __PROTO((STRPTR const));
  661. STRPTR        ReadWord        __PROTO((STRPTR, FILE *));
  662. void        ResetSettings    __PROTO((void));
  663. void        ReverseVideo    __PROTO((STRPTR String, FILE *fh));
  664. void        SetupVars        __PROTO((void));
  665. APTR        sfmemset        __PROTO((APTR to, int c, LONG n));
  666. int            ShiftArg        __PROTO((STRPTR *Argument));
  667. void        ShowIntStatus    __PROTO((void));
  668. void        SilentPrint        __PROTO((ULONG Line, ULONG Pos));
  669. APTR        StkPop            __PROTO((struct Stack *Stack));
  670. BOOL        StkPush            __PROTO((const APTR Data, struct Stack *Stack));
  671. APTR        StkTop            __PROTO((struct Stack *Stack));
  672. STRPTR        strcatm            __PROTO((STRPTR dest, STRPTR String, ...));
  673. STRPTR        strip            __PROTO((STRPTR, WORDBITS const));
  674. void        strrep            __PROTO((STRPTR, UBYTE const, UBYTE const));
  675. int            str_cmp            __PROTO((void const *, void const *));
  676. void        tackon            __PROTO((STRPTR, const STRPTR));
  677. void        tictoc            __PROTO((void));
  678. struct CharInfo *
  679.             TopChar            __PROTO((struct Stack *));
  680.  
  681.  
  682.  
  683. void        FooBar            __PROTO((void)); /* Generic test function */
  684.  
  685. #ifdef    STRMID_NEED
  686. WORD        strmid            __PROTO((const STRPTR source, STRPTR dest,
  687.                                     LONG pos, LONG len));
  688. #endif
  689.  
  690. #ifdef    STRUPR_NEED
  691. STRPTR        strupr            __PROTO((STRPTR));
  692. #endif
  693.  
  694. #ifdef    STRDUP_NEED
  695. STRPTR        strdup            __PROTO((STRPTR const));
  696. #endif
  697.  
  698. #define    realloc    realloc_
  699. void *        realloc_        __PROTO((void *,size_t));
  700.  
  701.  
  702.  
  703.  
  704. /* #define DEBUG */
  705. #ifdef        DEBUG
  706. #    undef NULL
  707. #    define NULL    ((void *) 0L)
  708. #endif
  709.  
  710.